package com.xhwl.logistics.service.business;

import com.xhwl.logistics.bo.cent.VehicleIntegratedConfigBO;
import com.xhwl.logistics.bo.manipulate.VehicleSyncBO;
import com.xhwl.logistics.component.LookupVehicleParkingLotHandler;
import com.xhwl.logistics.service.impl.redis.VehicleIntegratedConfigRedisServiceImpl;
import com.xhwl.logistics.strategy.IVehicleParkingLotHandler;
import org.springframework.beans.factory.annotation.Autowired;

//@Service
public class VehicleSyncBusinessService {

    @Autowired
    private LookupVehicleParkingLotHandler lookupVehicleParkingLotHandler;

    @Autowired
    private VehicleIntegratedConfigRedisServiceImpl vehicleIntegratedConfigRedisService;

    public void syncDevice(VehicleSyncBO vehicleSyncBO) {
        VehicleIntegratedConfigBO vehicleIntegratedConfigBO = vehicleIntegratedConfigRedisService.queryIntegratedConfigByProjectId(vehicleSyncBO.getProjectId());

        IVehicleParkingLotHandler vehicleParkingLotHandler = lookupVehicleParkingLotHandler.lookup(vehicleIntegratedConfigBO.getVehicleSystemInfoBO().getProductId());

        vehicleParkingLotHandler.syncDevice(vehicleIntegratedConfigBO);
    }

}
